<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link th:replace="fragments/dependency :: list-css">

<title>优铺Admin</title>
</head>

<body class="nav-md">
	<div class="container body">
		<div class="main_container">
			<!-- Left Menu -->
			<div th:replace="fragments/leftMenu :: leftMenu"></div>

			<!-- top navigation -->
			<div th:replace="fragments/header :: header"></div>


			<!-- page content -->
			<div class="right_col" role="main">


				<div class="ln_solid"></div>
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="x_panel">
						<div class="x_title">
							<h2>系统用户管理</h2>
							<ul class="nav navbar-right panel_toolbox">
								<li><a class="collapse-link"><i
										class="fa fa-chevron-up"></i></a></li>
							</ul>
							<div class="clearfix"></div>
						</div>
						<!-- 按钮区域 -->

						<!-- 搜索区域 -->
						<div class="x_content">
							<div class="form-inline">
								<div class="form-group">
									<label for="ex3">用户名：</label> <input type="text" id="ex3"
										name="name" th:value="${param.name}" class="form-control"
										placeholder=" ">
								</div>
								<div class="form-group">
									<label for="ex4">账户：</label> <input type="email" id="ex4"
										name="account" th:value="${param.account}"
										class="form-control" placeholder=" ">
								</div>
							</div>
						</div>
						<div class="x_title">
							<div class="clearfix"></div>
						</div>
						<div class="x_content">
							<button type="button" class="btn btn-round btn-primary hide"
								name="add" permission-rel="/sysAccount/addPage">新增</button>
							<button type="button" class="btn btn-round btn-success hide"
								name="query" permission-rel="/sysAccount/addPage">查询</button>
						</div>
						<div class="x_title">
							<div class="clearfix"></div>
						</div>
						<div class="x_content">
							<div class="table-responsive">
								<table class="table table-striped jambo_table bulk_action">
									<thead>
										<tr class="headings">
											<th class="column-title">编号</th>
											<th class="column-title">账号</th>
											<th class="column-title">用户名</th>
											<th class="column-title">角色</th>
											<th class="column-title no-link last"><span class="nobr">操作</span>
											</th>
										</tr>
									</thead>
									<tbody>
										<tr class="even pointer" th:each="entity : ${pageList}">
											<td th:text="${entity.id}"></td>
											<td th:text="${entity.account}"></td>
											<td th:text="${entity.name}"></td>
											<td th:text="${entity.sysRole?.roleName}"></td>
											<td><a href="javascript:;"
												class="btn btn-primary btn-xs hide"
												permission-rel="/sysAccount/detail"
												th:onclick="'list.detail(' + ${entity.id} + ')'"><i
													class="fa fa-folder"></i> 查看 </a> <a href="javascript:;"
												class="btn btn-info btn-xs hide"
												permission-rel="/sysAccount/updatePage"
												th:onclick="'list.update(' + ${entity.id} + ')'"><i
													class="fa fa-pencil"></i> 编辑 </a> <a href="javascript:;"
												class="btn btn-danger btn-xs hide"
												permission-rel="/sysAccount/delete"
												th:onclick="'list.delete(' + ${entity.id} + ')'"><i
													class="fa fa-trash-o"></i> 删除 </a></td>
										</tr>

									</tbody>
								</table>

							</div>
						</div>
					</div>
				</div>
				<div th:replace="fragments/page :: page"></div>


			</div>

			<!-- footer content -->
			<footer>
				<div class="pull-right">
					Powered by YouPu team<a target="_blank"
						href="http://www.youpuchina.com"></a>
				</div>
				<div class="clearfix"></div>
			</footer>
			<!-- /footer content -->
		</div>
	</div>

	<div th:replace="fragments/dependency :: list-js"></div>

	<script type="text/javascript">
	var list = {
		baseUrl:"sysAccount",
		area:['60%','90%'],
		init : function() {
			$('button[name=add]').bind('click',list.add);
			$('button[name=query]').bind('click',function(){
				window.location.href=list.query();
			});
		},
		detail:function(id){
			adminLayer.ifream({title:'查看',content:'/'+list.baseUrl+'/detail/?id='+id+'&readonly=y',area:list.area});
		},
		add:function(){
			adminLayer.ifream({title:'新增',content:'/'+list.baseUrl+'/addPage/',area:list.area});
		},
		update:function(id){
			adminLayer.ifream({title:'更新',content:'/'+list.baseUrl+'/updatePage/?id='+id+'&readonly=n',area:list.area});
		},
		delete:function(id){
			adminLayer.confirm({title:'警告',content:'确定删除吗？',yes:function(){
				httpClientForUpAdmin.del('/'+list.baseUrl+'/delete/?id='+id,null,function(data){
					if(data.Type==200){
						adminLayer.alert({content:'删除成功',yes:function(){
							location.reload();
						}});
					}
				});
			}});
			
		},
		query : function() {
			pageFoot.searchUrl = '/'+list.baseUrl+'/list';
			var name = $("input[name=name]").val();
			var account = $("input[name=account]").val();
			return pageFoot.addParam("name", name).addParam("account",account).searchUrl;
		}
	}
	pageFoot.getCurrentUrl = function() {
		return list.query();
	}
	pageFoot.init();
	list.init();
</script>
</body>
</html>
